package main;

import java.io.File;

import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;

public class FileManager {

  public File askSourceFile() {
    final JFileChooser chooser = new JFileChooser();
    FileFilter filter = new FileNameExtensionFilter("subtitles", "srt", "txt");
    chooser.addChoosableFileFilter(filter);
    chooser.setFileFilter(filter);
    chooser.showOpenDialog(null);
    return chooser.getSelectedFile();
  }
}